$(function() {
	var currentDate = new Date();
	var circleDateTime = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()).getTime();
	var currentYear = new Date().getFullYear();
	var $calendar = $('#calendar');
	$calendar.calendar({
		enableContextMenu: true,
		enableRangeSelection: true,
		'clickDay': function(e) {
			//进入第二级日历页面
			var year = e.date.getFullYear();
			var month = e.date.getMonth() +　1;
			location.href="activity.html?year="+year+'&month='+month;
		},
		'dataSource':[
    {
        "endDate": new Date(2016,06,16),
        "id": "0",
        "localhost": "",
        "name": "",
        "startDate": new Date(2016,06,09)
    },
    {
        "endDate": new Date(2016,06,16),
        "id": "1",
        "localhost": "",
        "name": "",
        "startDate": new Date(2016,06,12)
    },
    {
        "endDate": new Date(2016,06,22),
        "id": "2",
        "localhost": "",
        "name": "",
        "startDate": new Date(2016,06,13)
    },
    {
        "endDate": "",
        "id": "3",
        "localhost": "",
        "name": "",
        "startDate": new Date(2016,06,18)
    },
    {
        "endDate": "",
        "id": "4",
        "localhost": "",
        "name": "",
        "startDate": new Date(2016,06,18)
    }
],
		customDayRenderer: function(element, date) {
			if(date.getTime() == circleDateTime) {
				$(element).css({
					'background-color': 'red',
					'color': 'white',
					'border-radius': '8px'
				});
			}
		}
	});
	$('.arrow-prev').click(function() {
		$('.prev').trigger('click');
	});
	$('.arrow-next').click(function() {
		$('.next').trigger('click');
	});
});
